//
//  JJVoiceHelper.h
//  swiftProject
//
//  Created by yangjian on 2021/12/6.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface JJVoiceRecordHelper : NSObject

+ (instancetype)shared;

//录制的时候,采用的是wav格式的,传入路径 会被强转wav (传入 /xxx/xxx 内部转为 /xxx/xxx.wav)
- (void)startRecord_path:(NSString *)path
              completion:(void(^)(NSError *_Nullable error))completion;

//录制的是wav格式,返回的是amr格式,所以返回的是amr路径
-(void)stopRecord_completion:(void(^)(NSString *completePath, NSInteger duration))completion;

- (void)cancelRecord;

//将wav转amr
- (BOOL)convertWAVtoAMR_wavPath:(NSString *)wavPath amrPath:(NSString*)amrPath;

//将amr转wav
- (BOOL)convertAMRtoWAV_amrPath:(NSString*)amrPath wavPath:(NSString *)wavPath;

@end

NS_ASSUME_NONNULL_END
